home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
185_01
/
hsh.doc
< prev
next >
Wrap
Text File
|
1985-08-19
|
10KB
|
331 lines
HSH.DOC Version 1.1 6 Oct 85 Page 1
Copyright 1985 Michael M Rubenstein
This software and the accompanying documentation may be
distributed freely for noncommercial use.
Credits.
ZCPR3 is a trademark of Richard L. Conn.
CP/M is a trademark of Digital Research Incorporated.
WordStar is a trademark of Micropro International Corporation.
C/80 is a trademark of The Software Toolworks.
Modifications.
1.1 Fixed handling of wrap around when the history is full.
Description.
HSH is a history processing ZCPR3 shell. It provides the ability
to recall and edit previous commands and allows much more
sophisticated editing than is found in the normal CP/M or ZCPR3
command processor.
For example, with HSH if the command
mcpy b:=*.dat
is typed and one notices that the command should have been
"mcopy", one can simply move the cursor back to the "p" and
insert an "o". If the command is entered and an error message
received, the command can be recalled and edited in the same
manner.
Unlike many other shells, HSH is intended to be a normal
operating environment. Therefore, it generates no noise unless
it's special features are invoked. For the most part, the user
sees the same results as if HSH were not present.
HSH operates best in conjunction with a ram disk or a high speed
hard disk. Those with slower disks are likely to find response
lethargic with HSH present.
Requirements.
HSH.DOC Version 1.1 6 Oct 85 Page 2
HSH requires ZCPR3 with external command line and shell stack.
The current version requires a video terminal which automatically
wraps lines and which allows backspacing from column one to the
end of the previous line. About 8K of disk space is required for
the program. The history file requires 384 bytes plus 256 bytes
per history line being kept. The default of 10 history lines
requires 4K disk space. The program and history file should be
on a ram disk or high speed hard disk for best results.
Running HSH.
Before running HSH, it must be installed with Z3INS in the same
way as any other ZCPR3 utility.
HSH is run with the command
hsh
One operand, the number of history lines to keep (from 0 through
100) may be included, e.g.,
hsh 50
If no operand appears on the command line, HSH will use the value
from the history file, HSH.VAR, or 10 if there is no history
file. This allows one to exit HSH and return without loosing the
history. If a numeric operand does appear, a new history file
will be created (the old will be deleted) and any previous
history will be lost.
If there is no problem, HSH will install itself and display a
sign on message. HSH may be started from a submit file, in which
case the submit file will complete before HSH actually takes
control.
HSH searches for itself (by whatever name it is called) along the
current path. Normally the current directory is not searched
unless it is explicitly included on the path. This may be
changed by patching the byte at 010Bh to nonzero.
HSH puts the history file on the "root" directory -- the last
directory in the search path. For best results, the "root"
directory and the copy of HSH that it finds in searching for
itself should both be on a ram disk. I use a path like
RAMDISK $$ ROOT RAMDISK
so critical programs are found on the ram disk first. Note that
the "root" directory with this path is RAMDISK, not ROOT.
The HSH prompt looks exactly like the usual ZCPR3 prompt.
Commands may be typed and will be executed normally. The only
exceptions are the SAVE, GET, GO, and JUMP commands. These will
HSH.DOC Version 1.1 6 Oct 85 Page 3
not give the desired effect if entered as single commands at the
prompt because HSH is in the TPA. For example, the sequence
A0>ddt test.com
A0>save 16 newtest.com
will result in the first 16 pages of HSH being saved. To get the
desired effect, one must plan ahead and type multiple commands
A0>ddt test.com;save 16 newtest.com
which works since HSH does not regain control between the two
commands.
HSH recognizes two characters as special if they appear as the
first character of a typed line. Both are recognized
immediately (i.e., no carriage return is necessary).
<ESC> - (Escape key). Exit HSH.
^C - (Control C). Warm boot. Same as the standard
CP/M or ZCPR2 ^C.
Entering commands in HSH is similar to doing so in the standard
command processor, but there are numerous additional editing
options. These have been patterned (a bit loosely in a few
places) after the WordStar editing commands.
^A - Back one word
^D - Forward one character.
^F - Forward one word.
^G - Delete current character.
^H - (Backspace). Delete previous character.
^J - Display edit command help message and resume
editing line.
^P - Remove any special meaning from the next
character. For example, ^P^H inserts a ^H
(backspace) into the line.
^Q - Back one command.
^R - Forward one command.
^S - Back one character without deleting.
^T - Delete to beginning of next word.
^U - Delete entire line.
HSH.DOC Version 1.1 6 Oct 85 Page 4
^V - Insert a character.
^W Delete to beginning of previous word.
^Y - Delete to end of line.
^Z - Delete current command. If the cursor is on a
semicolon, the command to the right will be
deleted.
The command will be processed when RETURN or ENTER is pressed.
The cursor need not be at the end of the line.
The real power of HSH, however, is in the ability to recall and
edit previous command lines. This is controlled by several
additional command keys:
^E - Recall previous command line. Repeated
application gets successively earlier command
lines. If there is no previous command line (or
it has not been kept in the history), the bell
will sound. The ^U editing command resets the
internal pointer to the end so the next ^E gets
the last command line executed again.
^L - Searches for a previous command line which matches
the current line to the left of the cursor. Case
is immaterial. If none is found, the bell will
sound. For example, if the previous command lines
were
dir
ws test.doc
type whatever.c
whatever;type what.out
ws what.out